<?php
include 'common.php';

if ($user->hasLogin() || !$options->allowRegister) {
    $response->redirect($options->siteUrl);
}
$rememberName = htmlspecialchars(Typecho_Cookie::get('__typecho_remember_name'));
$rememberMail = htmlspecialchars(Typecho_Cookie::get('__typecho_remember_mail'));
Typecho_Cookie::delete('__typecho_remember_name');
Typecho_Cookie::delete('__typecho_remember_mail');

$bodyClass = 'body-100';

include 'header.php';
?>
    <!-- Content
    ================================================== -->
    <div uk-height-viewport class="uk-flex uk-flex-middle">
        <div class="uk-width-2-3@m uk-width-1-2@s m-auto rounded uk-overflow-hidden shadow-lg">
            <div class="uk-child-width-1-2@m uk-grid-collapse bg-gradient-primary" uk-grid>

                <!-- column one -->
                <div class="uk-margin-auto-vertical uk-text-center uk-animation-scale-up p-3 uk-light">
                    <img src="assets/images/logo-light-icon.png" alt="">
                    <h3 class="mb-3 mt-lg-4"> OYO模板</h3>
                    <p>OYO </p>
                </div>

                <!-- column two -->
                    <div class="uk-card-default px-5 py-8">
                        <div class="mb-4 uk-text-center">
                            <h2 class="mb-0">建立新账户</h3>
                            <p class="my-2">注册一个新的账户</p>
                        </div>

                    <form class="uk-child-width-1-1 uk-grid-small" action="<?php $options->registerAction(); ?>" method="post" name="register" role="form">

                        <div>
                            <div class="uk-form-group">
                                <label form="name" class="uk-form-label"><?php _e('用户名'); ?></label>

                                <div class="uk-position-relative w-100">
                                    <span class="uk-form-icon">
                                        <i class="icon-feather-user"></i>
                                    </span>
                                    <input class="uk-input" type="text" id="name" name="name" placeholder="<?php _e('用户名'); ?>" value="<?php echo $rememberName; ?>" autofocus />
                                </div>

                            </div>
                        </div>
                        <div>
                            <div class="uk-form-group">
                                <label form="mail" class="uk-form-label"><?php _e('Email'); ?></label>

                                <div class="uk-position-relative w-100">
                                    <span class="uk-form-icon">
                                        <i class="icon-feather-mail"></i>
                                    </span>
                                    <input class="uk-input" type="email" id="mail" name="mail" placeholder="<?php _e('Email'); ?>" value="<?php echo $rememberMail; ?>">
                                </div>

                            </div>
                        </div>
                        <div>
                            <div class="mt-4 uk-flex-middle uk-grid-small" uk-grid>
                                <div class="uk-width-expand@s">
                                    <p> 有账户吗？ <a href="<?php $options->adminUrl('login.php'); ?>">点击登录</a></p>
                                </div>
                                <div class="uk-width-auto@s">
									<button type="submit" class="button primary"><?php _e('注册'); ?></button>
                                </div>
                            </div>
                        </div>

                    </form>
                </div><!--  End column two -->

            </div>
        </div>
    </div>

    <!-- Content -End
    ================================================== -->


     

    <!-- javaScripts
    ================================================== -->
    <script src="assets/js/uikit.js"></script>
    <script src="assets/js/simplebar.js"></script>
    


<?php 
include 'common-js.php';
?>
<script>
$(document).ready(function () {
    $('#name').focus();
});
</script>
<?php
include 'footer.php';
?>
